import random
import string
# 各类字符
print(string.ascii_lowercase,string.digits,string.ascii_uppercase,string.punctuation)

a = ""
for i in range(20):
    # 在范围内随机生成一个字符
    str = random.choice(string.ascii_lowercase + string.digits)
    a = str + a
print(a)

# 去除字符串中的空格
str = "a b c linux"
result = ""
for i in str.split():
    result = result + i
print(result)